<?php $this->renderPartial("application.views.layouts._menu");?> 
<?php 
    $img_err=Common::getImageError(); 
    if($type==1){
        $folder = "game";
        $controller="fileGame";
        $str_id="gameId";
        $link_down = Yii::app()->params['url_mtop']."fileGame/download?gameId=".$data_detail['id']."&userId=".$_SESSION['userId']; 
    }
    if($type==2){
        $folder = "app";
        $controller="fileApp";
        $str_id="appId";
        $link_down = Yii::app()->params['url_mtop']."fileApp/download?appId=".$data_detail['id']."&userId=".$_SESSION['userId'];
    }
 ?>
<div class="chitiet">
<?php if($type !=3){ ?>
    <a href="<?php echo $link_down; ?>"><img width="188" height="41" class="kc_chitiet" alt="" src="<?php echo Yii::app()->params['static_url'];?>images/tenweb_icon_tai-mien-phi.png"></a>
    <?php } ?>
    <?php echo $data_detail['description']; ?>
    <?php if($type !=3){ ?>
    <a href="<?php echo $link_down ?>"><img width="188" height="41" class="kc_chitiet" alt="" src="<?php echo Yii::app()->params['static_url'];?>images/tenweb_icon_tai-mien-phi.png"></a>
    <?php } ?>
</div>
<h2><strong><?php if(isset($data_detail['isOnline'])&&$type==1){echo $data_detail['isOnline']==1 ? "Game Online khác" : "Game Offline khác"; }else if($type==2){echo "Ứng dụng khác";} else if($type==3){echo "Sự kiện khác" ;} ?></strong></h2>
<?php if($type !=3){ ?>
<?php foreach($data_random as $key=>$value){ ?>
<div class="Game_nd">
    <div class="Game_nd_left">
        <a href="<?php echo Url::createUrl("home/detail",array("id"=>$value['id'],"type"=>isset($value['isOnline'])?1:2)) ?>"><img onError="this.src='<?php echo $img_err; ?>'" width="65" height="65" alt="" src="<?php echo Common::getImage($value['picture'],$folder,$value['create_date'],''); ?>"></a>
    </div>
    <div class="Game_nd_right">
        <a href="<?php echo Url::createUrl("home/detail",array("id"=>$value['id'],"type"=>isset($value['isOnline'])?1:2)) ?>"><h3><?php echo $value['title']; ?></h3></a>
        <p><?php echo $value['introtext']; ?></p>
        <a href="#"><img class="kc_Game" alt="" src="<?php echo Yii::app()->params['static_url'];?>images/tenweb_icon_dowload.png"></a><a class="do" href="<?php echo Yii::app()->params['url_mtop'].$controller."/download?".$str_id."=".$value['id']."&userId=".$_SESSION['userId'] ?>">Tải miễn phí</a> (252 lượt tải)
    </div>
    <div class="both"></div>
</div>
<?php } ?>
<div class="them"><a class="xam" href="<?php if(isset($data_detail['isOnline'])){echo $data_detail['isOnline']==1 ? Url::createUrl("home/gameOnline") : Url::createUrl("home/gameOffline"); }else{echo Url::createUrl("home/app");} ?>"><?php if(isset($data_detail['isOnline'])){echo $data_detail['isOnline']==1 ? "Game Online khác" : "Game Offline khác"; }else{echo "Ứng dụng khác";} ?> »</a></div>
<?php } else { ?>
<div class="SK">
    <?php foreach($data_random as $key=>$value){ ?>
        <a class="chu_SK" href="<?php echo Url::createUrl("home/detail",array("id"=>$value['id'],"type"=>3)); ?>"><img width="9" height="9" class="kc_SK" alt="" src="<?php echo Yii::app()->params['static_url'];?>images/tenweb-icon-sukien-tieude.gif"><?php echo $value['title']; ?><br></a>
        <?php } ?>
    <a class="xam" href="<?php echo Url::createUrl("home/event") ?>"><strong>Sự kiện khác »</strong></a>
</div>
<?php } ?>